/*!
    \copyright  Copyright (c) 2005 - 2024 Qualcomm Technologies International, Ltd.
                All Rights Reserved.
                Qualcomm Technologies International, Ltd. Confidential and Proprietary.
    \version    
    \file       state_proxy_connection.c
    \ingroup    state_proxy
    \brief      Handling of connection manager events in the state proxy.
*/

/* local includes */
#include "state_proxy.h"
#include "state_proxy_private.h"
#include "state_proxy_marshal_defs.h"
#include "state_proxy_connection.h"
#include "state_proxy_link_quality.h"

/* framework includes */
#include <connection_manager.h>

static void stateProxy_LinkQualityKickOnTransport(TRANSPORT_T transport)
{
    if(transport == TRANSPORT_BREDR_ACL)
    {
        stateProxy_LinkQualityKick();
    }
    else if(transport == TRANSPORT_BLE_ACL)
    {
        stateProxy_LeLinkQualityKick();
    }
}

void stateProxy_HandleConManagerConnectInd(const CON_MANAGER_TP_CONNECT_IND_T* ind)
{
    stateProxy_LinkQualityKickOnTransport(ind->tpaddr.transport);
}

void stateProxy_HandleConManagerDisconnectInd(const CON_MANAGER_TP_DISCONNECT_IND_T* ind)
{
    stateProxy_LinkQualityKickOnTransport(ind->tpaddr.transport);
}

void stateProxy_HandleMirrorProfileConnectInd(const MIRROR_PROFILE_CONNECT_IND_T *ind)
{
    UNUSED(ind);
    stateProxy_LinkQualityKick();
}

void stateProxy_HandleMirrorProfileDisconnectInd(const MIRROR_PROFILE_DISCONNECT_IND_T *ind)
{
    UNUSED(ind);
    stateProxy_LinkQualityKick();
}

void stateProxy_HandleLeAudioUnicastCisConnected(void)
{
#ifdef INCLUDE_HDMA_CIS_RSSI_EVENT
    stateProxy_CisRssiKick();
#endif

}

void stateProxy_HandleLeAudioUnicastCisDisconnected(void)
{
#ifdef INCLUDE_HDMA_CIS_RSSI_EVENT    
    stateProxy_CisRssiKick();
#endif

}

